<template>
	<z-paging
		ref="paging"
		:auto="false"
		:refresher-enabled="false"
		:loading-more-enabled="false"
	>
		<view class="user-board">
			<view class="status_bar"></view>
			<view class="info">
				<u-avatar class="avatar" size="60"></u-avatar>
				<view class="user">
					<view class="name">{{ userName }}</view>
					<view class="etc">
						<i class="iconfont icon-file-protect"></i>
						<text>已实名</text>
					</view>
				</view>
			</view>
			<view class="bg">
				<image class="image" src="/static/board.jpg" mode="top right"></image>
			</view>
		</view>
		<view class="user-text">
			<u-row>
				<u-col span="4">
					<view class="box">
						<view class="info">
							<u-count-to
								:startVal="0"
								:endVal="100"
								separator=","
								font-size="20"
								color="#333"
							>
							</u-count-to>
							<text class="unit">天</text>
						</view>
						<view class="title">您已使用</view>
					</view>
				</u-col>
				<u-col span="4">
					<view class="box">
						<view class="info">
							<i class="iconfont icon-file-text"></i>
						</view>
						<view class="title">商品收藏</view>
					</view>
				</u-col>
				<u-col span="4">
					<view class="box">
						<view class="info">
							<i class="iconfont icon-file-text"></i>
						</view>
						<view class="title">浏览记录</view>
					</view>
				</u-col>
			</u-row>
		</view>
		<view class="my-order">
			<view class="title">
				<text>我的订单</text>
				<view class="show-all">
					<text>全部</text>
					<u-icon name="arrow-right" color="#999" size="12"></u-icon>
				</view>
			</view>
			<u-row>
				<u-col span="3">
					<view class="box">
						<view class="icon">
							<i class="iconfont icon-order"></i>
						</view>
						<view class="name">已下单</view>
					</view>
				</u-col>
				<u-col span="3">
					<view class="box">
						<view class="icon">
							<i class="iconfont icon-order"></i>
						</view>
						<view class="name">
							<text>待付款</text>
						</view>
					</view>
				</u-col>
				<u-col span="3">
					<view class="box">
						<view class="icon">
							<i class="iconfont icon-order"></i>
						</view>
						<view class="name">已完成</view>
					</view>
				</u-col>
				<u-col span="3">
					<view class="box">
						<view class="icon">
							<i class="iconfont icon-order"></i>
						</view>
						<view class="name">已取消</view>
					</view>
				</u-col>
			</u-row>
		</view>
		<view class="menu-box">
			<view class="group user-cell-group">
				<u-cell-group>
					<u-cell title="个人信息" icon="account" isLink></u-cell>
					<u-cell title="收货地址" icon="car" isLink></u-cell>
					<u-cell title="在线客服" icon="kefu-ermai" isLink></u-cell>
					<u-cell icon="phone">
						<view slot="title">
							<text style="margin-left: 3px; font-size: 30rpx">联系我们</text>
						</view>
						<view slot="value">
							<view class="call-phone">
								<!-- <u-icon class="icon" name="phone" color="#ff9600" size="20"></u-icon> -->
								<text>400-000-0000</text>
							</view>
						</view>
					</u-cell>
					<u-cell title="服务须知" icon="info-circle" isLink></u-cell>
					<u-cell title="设置" icon="setting" isLink></u-cell>
				</u-cell-group>
			</view>
		</view>
		<Logout />
		<view class="information">
			<text> 《隐私政策》 </text>
			<text> 《用户协议》 </text>
		</view>
	</z-paging>
</template>

<script>
import Logout from './_components/Logout.vue'

export default {
	components: {
		Logout,
	},
	data() {
		return {
			userName: '',
		}
	},
	onLoad() {
		//
	},
	onShow() {
		this.$store
			.dispatch('getLoginInfo')
			.then((res) => {
				this.userName = res.UserName
			})
			.catch(() => {})
	},
	computed: {
		// 在线状态
		isOnline() {
			return this.$store.getters.isOnline
		},
	},
	methods: {
		//
	},
}
</script>

<style lang="scss">
page {
	background-color: #f5f5f5;
}

.user-cell-group {
	.u-cell {
		position: relative;
	}

	.cell-button {
		display: inline-block;
		position: absolute;
		z-index: 2;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		opacity: 0;
	}

	.call-phone {
		display: flex;
		color: $theme-color;
		align-items: center;

		.icon {
			position: relative;
			top: 2px;
			margin-right: 3px;
		}
	}
}
</style>

<style lang="scss" scoped>
.status_bar {
	height: var(--status-bar-height);
	width: 100%;
}

.user-board {
	position: relative;
	padding-top: var(--status-bar-height);
	background-color: rgba(0, 0, 0, 0.9);

	.info {
		position: relative;
		z-index: 2;
		padding: 80rpx 60rpx 60rpx;
		display: flex;
		color: #fff;

		.user {
			margin-left: 30rpx;

			.name {
				font-size: 44rpx;
			}

			.etc {
				display: flex;
				align-items: center;
				color: #ccc;
				margin-top: 10rpx;

				.iconfont {
					position: relative;
					top: 3rpx;
					font-size: 38rpx;
					color: #fff;
				}

				text {
					font-size: 28rpx;
					margin-left: 5rpx;
				}
			}
		}
	}

	.bg {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		opacity: 0.3;

		.image {
			width: 100%;
			height: 100%;
		}
	}
}

.user-text {
	margin: 20rpx 0;

	.box {
		text-align: center;

		.info {
			.value {
				font-size: 36rpx;
				color: #000;
			}

			.iconfont {
				font-size: 40rpx;
				color: #000;
				line-height: 52rpx;
			}

			.unit {
				color: darkred;
				font-size: 24rpx;
				margin-left: 4.5rpx;
			}
		}

		.title {
			font-size: 28rpx;
			color: #666;
			margin-top: 9rpx;
		}
	}
}

.my-order {
	margin: 30rpx;
	padding: 20rpx;
	border-radius: 10rpx;
	box-shadow: 0 0 15rpx #ddd;
	background-color: #fff;

	.title {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 28rpx;
		color: #000;
		margin-bottom: 10rpx;

		.show-all {
			display: flex;
			align-items: center;
			font-size: 26rpx;
			color: #999;

			text {
				margin-right: 10rpx;
			}
		}
	}

	.box {
		text-align: center;
		margin: 25rpx 0 10rpx;

		.iconfont {
			font-size: 40rpx;
			color: #000;
		}

		.name {
			font-size: 28rpx;
			color: #666;
			margin-top: 9rpx;
		}
	}
}

.menu-box {
	margin: 30rpx 30rpx;
	background-color: #fff;

	.group {
		margin-bottom: 30rpx;
		border-radius: 10rpx;
		box-shadow: 0 0 15rpx #ddd;
		overflow: hidden;
	}

	.iconfont {
		font-size: 34rpx;
		margin-right: 10rpx;
	}

	.u-gap {
		display: none;
	}

	.label {
		font-size: 24rpx;
		color: #999;
		line-height: 1;
	}
}

.information {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 0 0 30rpx;

	text {
		font-size: 28rpx;
		color: $theme-color;
		margin: 0 10rpx;
	}
}

.u-cell-group {
	background-color: #fff;
}
</style>
